package com.yuebao.result;

import com.yuebao.exception.CustomerException;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
//public class Result {
//    private Integer code;
//    private String msg;
//    private Object data;
//
//    public static Result ok(Object data){
//        return new Result(200,"success",data);
//    }
//    public static Result fail(CustomerException e){
//        return new Result(e.getCode(),e.getMsg(),e.getErrorDetail());
//    }
//}
public class Result {
    private Integer code;
    private String msg;
    private Object data;

    public static Result ok(Object data){
        return new Result(200,"success",data);
    }
    public static Result fail(String msg){
        return new Result(500,msg,null);
    }
}
